<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: coap_time.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('coap__time_8h.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">coap_time.h File Reference</div></div>
</div><!--header-->
<div class="contents">

<p>Clock Handling.  
<a href="#details">More...</a></p>
<div class="textblock"><code>#include &lt;stdint.h&gt;</code><br />
</div>
<p><a href="coap__time_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gabf672e8aaf725f9ccbc4fc0aa202a5bb" id="r_gabf672e8aaf725f9ccbc4fc0aa202a5bb"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#gabf672e8aaf725f9ccbc4fc0aa202a5bb">COAP_TICKS_PER_SECOND</a>&#160;&#160;&#160;((<a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>)(1000U))</td></tr>
<tr class="memdesc:gabf672e8aaf725f9ccbc4fc0aa202a5bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Use ms resolution on POSIX systems.  <br /></td></tr>
<tr class="separator:gabf672e8aaf725f9ccbc4fc0aa202a5bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:ga97ff1502e211b4ee6c3f15a598833438" id="r_ga97ff1502e211b4ee6c3f15a598833438"><td class="memItemLeft" align="right" valign="top">typedef uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a></td></tr>
<tr class="memdesc:ga97ff1502e211b4ee6c3f15a598833438"><td class="mdescLeft">&#160;</td><td class="mdescRight">This data type represents internal timer ticks with COAP_TICKS_PER_SECOND resolution.  <br /></td></tr>
<tr class="separator:ga97ff1502e211b4ee6c3f15a598833438"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3f27196958c88d1edc17911f5f39ef82" id="r_ga3f27196958c88d1edc17911f5f39ef82"><td class="memItemLeft" align="right" valign="top">typedef time_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#ga3f27196958c88d1edc17911f5f39ef82">coap_time_t</a></td></tr>
<tr class="memdesc:ga3f27196958c88d1edc17911f5f39ef82"><td class="mdescLeft">&#160;</td><td class="mdescRight">CoAP time in seconds since epoch.  <br /></td></tr>
<tr class="separator:ga3f27196958c88d1edc17911f5f39ef82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga2dd35de82321ad2466dab00275914544" id="r_ga2dd35de82321ad2466dab00275914544"><td class="memItemLeft" align="right" valign="top">typedef int64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#ga2dd35de82321ad2466dab00275914544">coap_tick_diff_t</a></td></tr>
<tr class="memdesc:ga2dd35de82321ad2466dab00275914544"><td class="mdescLeft">&#160;</td><td class="mdescRight">This data type is used to represent the difference between two clock_tick_t values.  <br /></td></tr>
<tr class="separator:ga2dd35de82321ad2466dab00275914544"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga4722a7e40ba99c4d3feba19de1b980be" id="r_ga4722a7e40ba99c4d3feba19de1b980be"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#ga4722a7e40ba99c4d3feba19de1b980be">coap_clock_init</a> (void)</td></tr>
<tr class="memdesc:ga4722a7e40ba99c4d3feba19de1b980be"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes the internal clock.  <br /></td></tr>
<tr class="separator:ga4722a7e40ba99c4d3feba19de1b980be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga350826988e63ff446a2a84034ecdf43d" id="r_ga350826988e63ff446a2a84034ecdf43d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#ga350826988e63ff446a2a84034ecdf43d">coap_ticks</a> (<a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> *t)</td></tr>
<tr class="memdesc:ga350826988e63ff446a2a84034ecdf43d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets <code>t</code> to the internal time with COAP_TICKS_PER_SECOND resolution.  <br /></td></tr>
<tr class="separator:ga350826988e63ff446a2a84034ecdf43d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa7cb35533d86c8f87eac2ad42de0323" id="r_gaaa7cb35533d86c8f87eac2ad42de0323"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__clock.html#ga3f27196958c88d1edc17911f5f39ef82">coap_time_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#gaaa7cb35533d86c8f87eac2ad42de0323">coap_ticks_to_rt</a> (<a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> t)</td></tr>
<tr class="memdesc:gaaa7cb35533d86c8f87eac2ad42de0323"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function that converts coap ticks to wallclock time.  <br /></td></tr>
<tr class="separator:gaaa7cb35533d86c8f87eac2ad42de0323"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaefd1d943d41dc7a8c32188741bad4844" id="r_gaefd1d943d41dc7a8c32188741bad4844"><td class="memItemLeft" align="right" valign="top">uint64_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#gaefd1d943d41dc7a8c32188741bad4844">coap_ticks_to_rt_us</a> (<a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> t)</td></tr>
<tr class="memdesc:gaefd1d943d41dc7a8c32188741bad4844"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function that converts coap ticks to POSIX wallclock time in us.  <br /></td></tr>
<tr class="separator:gaefd1d943d41dc7a8c32188741bad4844"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0e2d5d4667e8b7a44c375cdb378b8d1b" id="r_ga0e2d5d4667e8b7a44c375cdb378b8d1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#ga0e2d5d4667e8b7a44c375cdb378b8d1b">coap_ticks_from_rt_us</a> (uint64_t t)</td></tr>
<tr class="memdesc:ga0e2d5d4667e8b7a44c375cdb378b8d1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper function that converts POSIX wallclock time in us to coap ticks.  <br /></td></tr>
<tr class="separator:ga0e2d5d4667e8b7a44c375cdb378b8d1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9b6406a84eca7917db0bb39cd8cb44ab" id="r_ga9b6406a84eca7917db0bb39cd8cb44ab"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#ga9b6406a84eca7917db0bb39cd8cb44ab">coap_time_lt</a> (<a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> a, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> b)</td></tr>
<tr class="memdesc:ga9b6406a84eca7917db0bb39cd8cb44ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <code>1</code> if and only if <code>a</code> is less than <code>b</code> where less is defined on a signed data type.  <br /></td></tr>
<tr class="separator:ga9b6406a84eca7917db0bb39cd8cb44ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabd0a10d70e913cfb419648c910565694" id="r_gabd0a10d70e913cfb419648c910565694"><td class="memItemLeft" align="right" valign="top"><a class="el" href="libcoap_8h.html#a58b4446dccd0b8c21b3532ef6b77a57d">COAP_STATIC_INLINE</a> int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__clock.html#gabd0a10d70e913cfb419648c910565694">coap_time_le</a> (<a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> a, <a class="el" href="group__clock.html#ga97ff1502e211b4ee6c3f15a598833438">coap_tick_t</a> b)</td></tr>
<tr class="memdesc:gabd0a10d70e913cfb419648c910565694"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns <code>1</code> if and only if <code>a</code> is less than or equal <code>b</code> where less is defined on a signed data type.  <br /></td></tr>
<tr class="separator:gabd0a10d70e913cfb419648c910565694"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Clock Handling. </p>

<p class="definition">Definition in file <a class="el" href="coap__time_8h_source.html">coap_time.h</a>.</p>
</div></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_a14d23a24002734ac2a3b997119f008e.html">coap2</a></li><li class="navelem"><a class="el" href="coap__time_8h.html">coap_time.h</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
